<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>正在投屏</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        :root {
            --primary: #4361ee;
            --primary-dark: #3a56d4;
            --secondary: #7209b7;
            --light: #f8f9fa;
            --dark: #212529;
            --success: #4cc9f0;
            --danger: #f72585;
            --card-bg: rgba(255, 255, 255, 0.95);
            --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
            --border-radius: 16px;
            --transition: all 0.3s ease;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: var(--dark);
            min-height: 100vh;
            padding: 20px;
            display: flex;
            justify-content: center;
            align-items: center;
            line-height: 1.6;
        }

        .container {
            max-width: 800px;
            width: 100%;
            margin: 0 auto;
        }

        .casting-card {
            background: var(--card-bg);
            border-radius: var(--border-radius);
            box-shadow: var(--shadow);
            overflow: hidden;
            padding: 40px;
            position: relative;
            text-align: center;
            transition: var(--transition);
        }

        .casting-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
        }

        .casting-header {
            margin-bottom: 30px;
            position: relative;
        }

        .casting-header::after {
            content: '';
            display: block;
            width: 80px;
            height: 4px;
            background: var(--primary);
            margin: 15px auto 0;
            border-radius: 2px;
        }

        h1 {
            font-size: 2.5rem;
            color: var(--primary);
            margin-bottom: 10px;
            font-weight: 700;
        }

        .status-indicator {
            display: inline-flex;
            align-items: center;
            padding: 8px 20px;
            background: rgba(67, 97, 238, 0.1);
            border-radius: 50px;
            margin-bottom: 30px;
            color: var(--primary);
            font-weight: 600;
        }

        .status-indicator i {
            margin-right: 8px;
            animation: pulse 1.5s infinite;
        }

        @keyframes pulse {
            0% { opacity: 0.7; }
            50% { opacity: 1; }
            100% { opacity: 0.7; }
        }

        .info-group {
            background: rgba(114, 9, 183, 0.05);
            border-radius: var(--border-radius);
            padding: 25px;
            margin: 25px 0;
            text-align: left;
            position: relative;
            overflow: hidden;
        }

        .info-group::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 5px;
            height: 100%;
            background: var(--secondary);
        }

        .info-label {
            font-weight: 600;
            color: var(--secondary);
            margin-bottom: 8px;
            display: flex;
            align-items: center;
        }

        .info-label i {
            margin-right: 10px;
            font-size: 1.2rem;
        }

        .info-value {
            font-size: 1.3rem;
            font-weight: 700;
            color: var(--dark);
            word-break: break-all;
        }

        .video-preview {
            background: #f0f2f5;
            border-radius: 12px;
            height: 200px;
            margin: 30px 0;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            overflow: hidden;
            background-image: linear-gradient(45deg, #e5e7eb 25%, transparent 25%), 
                              linear-gradient(-45deg, #e5e7eb 25%, transparent 25%),
                              linear-gradient(45deg, transparent 75%, #e5e7eb 75%),
                              linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);
            background-size: 20px 20px;
            background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
        }

        .video-preview::before {
            content: '视频预览';
            position: absolute;
            color: #9ca3af;
            font-weight: 500;
        }

        .video-preview i {
            font-size: 4rem;
            color: #c7d2fe;
        }

        form {
            margin-top: 30px;
        }

        .stop-btn {
            background: var(--danger);
            color: white;
            border: none;
            border-radius: 50px;
            padding: 16px 40px;
            font-size: 1.1rem;
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
            display: inline-flex;
            align-items: center;
            box-shadow: 0 4px 15px rgba(247, 37, 133, 0.3);
        }

        .stop-btn i {
            margin-right: 10px;
        }

        .stop-btn:hover {
            background: #e01a6f;
            transform: translateY(-3px);
            box-shadow: 0 7px 20px rgba(247, 37, 133, 0.4);
        }

        .stop-btn:active {
            transform: translateY(0);
        }

        .device-icon {
            position: absolute;
            top: 20px;
            right: 20px;
            font-size: 2rem;
            color: #e0e7ff;
        }

        /* 响应式设计 */
        @media (max-width: 768px) {
            .container {
                padding: 15px;
            }
            
            .casting-card {
                padding: 30px 20px;
            }
            
            h1 {
                font-size: 2rem;
            }
            
            .info-group {
                padding: 20px 15px;
            }
            
            .info-value {
                font-size: 1.1rem;
            }
            
            .stop-btn {
                padding: 14px 30px;
                font-size: 1rem;
                width: 100%;
            }
            
            .video-preview {
                height: 160px;
            }
        }

        @media (max-width: 480px) {
            h1 {
                font-size: 1.8rem;
            }
            
            .status-indicator {
                font-size: 0.9rem;
            }
            
            .video-preview {
                height: 140px;
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="casting-card">
            <i class="fas fa-tv device-icon"></i>
            
            <div class="casting-header">
                <h1>正在投屏</h1>
                <div class="status-indicator">
                    <i class="fas fa-circle"></i>
                    <span>正在投屏中...</span>
                </div>
            </div>
            
            <div class="info-group">
                <div class="info-label">
                    <i class="fas fa-desktop"></i>
                    当前设备
                </div>
                <div class="info-value">{{ .Device }}</div>
            </div>
            
            <div class="info-group">
                <div class="info-label">
                    <i class="fas fa-film"></i>
                    正在播放
                </div>
                <div class="info-value">{{ .Video }}</div>
            </div>
            
            <div class="video-preview">
                <i class="fas fa-play-circle"></i>
            </div>
            
            <form action="/stop" method="POST">
                <button type="submit" class="stop-btn">
                    <i class="fas fa-stop"></i>
                    停止投屏
                </button>
            </form>
        </div>
    </div>

    <script>
        // 简单的交互效果
        document.addEventListener('DOMContentLoaded', function() {
            const stopBtn = document.querySelector('.stop-btn');
            
            stopBtn.addEventListener('click', function(e) {
                e.preventDefault();
                
                // 添加确认对话框
                const isConfirmed = confirm('确定要停止投屏吗？');
                if (isConfirmed) {
                    e.target.closest('form').submit();
                }
            });
        });
    </script>
</body>
</html>